<include file="__THEME__/header" />
<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
<script type="text/javascript" src="../Public/js/miniblog.js"></script>

<div class="content"><!-- 内容 begin  --> 
  <include file="__THEME__/apps" />
  <div class="main">
    <div class="mainbox">
      <div class="mainbox_R">
        <div class="right_box">
          <h2>可能感兴趣的人</h2>
          <ul class="user_list">
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
          </ul>
        </div>
        <div class="right_box">
          <h2>可能感兴趣的人</h2>
          <ul class="user_list">
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
            <li> <span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
              <div class="name"><a href="#">杰然不同</a></div>
              <div><a href="javascript:void(0);" class="cGray2">关注她</a></div>
            </li>
          </ul>
        </div>
        <div class="right_box">
          <h2><a href="#">热门话题榜</a></h2>
          <ul class="topic_list">
            <li><a href="#" title="银行收费">银行收费(467)</a></li>
            <li><a href="#" title="ipad香港上市">ipad香港上市(15660)</a></li>
            <li><a href="#" title="唐山大地震">唐山大地震(7149)</a></li>
            <li><a href="#" title="小时候唱过的歌">小时候唱过的歌(27281)</a></li>
            <li><a href="#" title="世博">世博(32831)</a></li>
            <li><a href="#" title="新手上路">新手上路(16982)</a></li>
          </ul>
        </div>
      </div>
      <div class="mainbox_C">
    	<div class="topic">
        	<dl>
            	<dt class="f14px"><em><img class="icoWrite" src="__THEME__/images/zw_img.gif" /> <a href="###">我也说几句</a></em><strong>今日看点：</strong>大家一起聊"<a href="#">台风来了</a>"吧</dt>
                <dd class="left pl10" style="width:70px;"><span class="userPic"><a title="" href="#" rel="杰然不同"><img src="http://i.thinksns.com/data/userface/000/01/00/10007_middle_face.jpg?1280077283" card="1"></a></span>
                <div>加关注</div></dd>
              <dd style="margin-left:80px;">
              	<h3><a href="#">博客园</a></h3>
                <p>安徽,合肥&nbsp;&nbsp;<a href="#">粉丝3人</a></p>
                <p>一個新iPod touch打回X10........! 我是娛樂機人不適合手機!(今天 16:27)</p>
              </dd>
            </dl>
</div>
<switch name="ACTION_NAME">
	<case value="index">
	      <div class="tab-menu"><!-- 切换标签 begin  -->
	        <ul>
	          <li><a id="feed_colleague_item" rel="colleague" class="<eq name='type' value=''>on</eq> feed_item" href="{:U('home/user/index')}"><span>全部</span></a></li>
	          <li><a id="feed_all_item" rel="all" class="<eq name='type' value='original'>on</eq> feed_item" href="{:U('home/user/index',array('type'=>'original'))}"><span>原创</span></a></li>
	          <li><a id="feed_all_item" rel="all" class="<eq name='type' value='1'>on</eq> feed_item" href="{:U('home/user/index',array('type'=>'1'))}"><span>图片</span></a></li>
	          <li><a id="feed_all_item" rel="all" class="<eq name='type' value='3'>on</eq> feed_item" href="{:U('home/user/index',array('type'=>'3'))}"><span>视频</span></a></li>
	          <li><a id="feed_all_item" rel="all" class="<eq name='type' value='4'>on</eq> feed_item" href="{:U('home/user/index',array('type'=>'4'))}"><span>音乐</span></a></li>
	        </ul>
	      </div>
	</case>
	
	<case value="atme">
		<div class="tab-menu">
		<ul><li>提到我的</li></ul>
		</div>
	</case>
	
	<case value="collection">
		<div class="tab-menu">
		<ul><li>我收藏的</li></ul>
		</div>		
	</case>
</switch>	  

	  
	  
	  
      <div class="feedBox">
      	<eq name="ACTION_NAME" value="index">
		 <a href="javascript:void(0)" onclick="loadNew()" class="feed_msg_new">有<strong>0</strong>条新微博，点击更新</a>
		 </eq>
        <ul class="feed_list">
          <volist id="vo" name="list">
            <li class="lineD_btm" id="list_li_{$vo.id}">
              <div class="userPic"><a title="" href="{:U('home/space/index',array('uid'=>$vo['uid']))}" rel="{$vo.uid|getUserName}"><img src="{$vo.uid|getUserFace}" card="1"></a></div>
              <div class="feed_c">
                <div class="msgCnt"><a title="{$vo.uid|getUserName}" href="{:U('home/space/index',array('uid'=>$vo['uid']))}"><strong>{$vo.uid|getUserName}</strong></a>：{$vo.content|format}</div>
				<php>if( $vo['transpondid'] ){</php>
				<div class="feed_quote"> <img class="q_ico_arrow" src="__THEME__/images/zw_img.gif" />
                  <div class="q_tit"><img class="q_tit_l" src="__THEME__/images/zw_img.gif" /></div>
                  <div class="q_con"> 
                  <a href="{:U('home/space/index',array('uid'=>$vo['expend']['uid']))}">@{$vo.expend.uid|getUserName}</a>：{$vo.expend.content|format}  <a href="{:U('home/space/detail',array('id'=>$vo['expend']['id']))}">原文转发({$vo.expend.transpond}</a>)&nbsp;|&nbsp;<a href="{:U('home/space/detail',array('id'=>$vo['expend']['id']))}">原文评论({$vo.expend.comment})</a>
                  {$vo.expend.expend}
                  </div>
                  
                  <div class="q_btm"><img class="q_btm_l" src="__THEME__/images/zw_img.gif" /></div>
                  
                </div>
                <php>}else{</php>
                	{$vo.expend|format}
                <php>}</php>
			    <div class="feed_c_btm"> 
					<span class="right">
						<php>if( $vo['uid'] == $mid ){</php><a href="javascript:void(0)" onclick="deleteMini({$vo.id})">删除</a>&nbsp;&nbsp;|&nbsp;&nbsp;<php>}</php>
						<a href="javascript:void(0)" onclick="transpond({$vo.id})">转发({$vo.transpond})</a>&nbsp;&nbsp;|&nbsp;&nbsp;
						<a href="javascript:void(0)" onclick="stowMini({$vo.id},this)">收藏</a>&nbsp;&nbsp;|&nbsp;&nbsp;
						<a href="javascript:void(0)" rel="comment" minid="{$vo.id}" >评论({$vo.comment})</a>
					</span>
					 <cite>
					<a href="{:U('home/space/detail',array('id'=>$vo['id']))}">{$vo.cTime|friendlyDate='mohu'}</a></cite> 来自 <cite><a href="#">网站</a></cite> 
				</div>
                <div id="comment_list_{$vo.id}" style=""></div>
              </div>
            </li>
          </volist>
        </ul>
      </div>
    </div>
  </div>
  <div class="clear"></div>
</div>
</div>
<!-- 内容 end --> 

<script>
$(document).ready(function(){
	// 发布微博
	$('#miniblog_publish').submit(function() {
		if( $.trim( $('#content_publish').val() ) == '' ){
            alert('内容不能为空');		
			return false;
		}

		textareaStatus('sending');
		
		var options = {
		    success: function(txt) {
		      if(txt){
		    	   delTypeBox();
				   $(".feed_list").prepend( txt ).slideDown('slow');
				   $('#miniblog_publish').clearForm();
				   checkInputLength('#content_publish',140);
		      }else{
                  alert( '发布失败' );
		      }
			}
		};		
		$(this).ajaxSubmit( options );
	    return false;
   });

   $('#content_publish').keyup(function(event){
   		//if(event.shiftKey && event.keyCode==50 ){
			//alert( event.position() );
			//setSearchUser( $(this) );
		//}
   });
   



	//微博字数控制
	checkInputLength('#content_publish',140);
   
});

function setSearchUser(txt){
		reg = /@[^@\s]{1,20}$/g
		var   patt   =   new   RegExp(reg);
		var result = patt.exec( txt.val() );
		var textArea = document.getElementById('content_publish');
		if(result){
			var position = txt.position();
			$('#searchUser').css({top:position.top+23,left:position.left});
			$('#searchUser').show();
		}else{
			$('#searchUser').hide();
		}
}

//检测输入字符数
function checkInputLength(obj,num){
	var str = $(obj).val();  
	
	var len     = getLength(str);
	if(len==0){
		textareaStatus('off');
		$('.wordNum').html('你还可以输入<strong id="strconunt">'+ (num-len) + '</strong>字');
	}else if( len > num ){
		$('.wordNum').css('color','red');
		$('.wordNum').html('已超出<strong id="strconunt">'+ (len-num) +'</strong>字');
		textareaStatus('off');
	}else if( len <= num ){
		$('.wordNum').css('color','');
		$('.wordNum').html('你还可以输入<strong id="strconunt">'+ (num-len) + '</strong>字');
		textareaStatus('on');
	}
}

//发布窗口、按钮状态
function textareaStatus(type){
	if(type=='on'){
		$('#publish_handle').removeAttr('disabled')
		$('#publish_handle').attr('class','btn_big hand');
	}else if( type=='sending'){
		$('#publish_handle').attr('disabled','true')
		$('#publish_handle').attr('class','btn_big_disable hand');
	}else{
		$('#publish_handle').attr('disabled','true');
		$('#publish_handle').attr('class','btn_big_disable hand');
	}
}

//发布类型
function publish_type_box(type,mg_left){
	var publis_type_html = '';
	var type_num = 0;
	switch(type){
		case 'theme':
			var text = '#请在这里输入自定义话题#';
			var   patt   =   new   RegExp(text,"g");  
			var content_publish = $('#content_publish');
			var result;
						
			if( content_publish.val().search(patt) == '-1' ){
				content_publish.val( content_publish.val() + text);
			}
			
			var textArea = document.getElementById('content_publish');
			
			result = patt.exec( content_publish.val() );
			
			var end = patt.lastIndex-1 ;
			var start = patt.lastIndex - text.length +1;
			
			if (document.selection) { //IE
				 var rng = textArea.createTextRange();
				 rng.collapse(true);
				 rng.moveEnd("character",end)
				 rng.moveStart("character",start)
				 rng.select();
			}else if (textArea.selectionStart || (textArea.selectionStart == '0')) { // Mozilla/Netscape…
		        textArea.selectionStart = start;
		        textArea.selectionEnd = end;
		    }
		    textArea.focus();
			checkInputLength('#content_publish',140);
			return ;
		break;
		
		case 'image':
			type_num = 1;
			publish_type_html = '<div class="btn_green" href="javascript:void(0);">从电脑选择图片'+
								'<form action=\'{:U("miniblog/Operate/uploadpic")}\' enctype="multipart/form-data" method="post" id="uploadpic">'+
								'<input type="file" hidefoucs="true" name="pic" onchange="upload(this)">'+
								'</form></div><div>仅支持JPG、GIF、PNG、JPEG图片文件，且文件小于2M</div>';
		break;
		
		case 'video':
			type_num = 3;
			publish_type_html = '请输入新浪播客、优酷网、土豆网、酷6网等视频网站的视频播放页链接： <div><input name="publish_type_data" type="text" style="width:86%" value="" /></div>';
		break;
		
		
		case 'music':
			type_num = 4;
			publish_type_html = '请输入歌曲链接地址：<div><input name="publish_type_data" type="text" style="width:300px" value="" /></div>';
		break;		
		
	}
	
	$('input[name="publish_type"]').val( type_num );
	
	var html = '<div class="talkPop"><div  style="position: relative; height: 7px; line-height: 3px;">'
		     + '<img class="talkPop_arrow" style="margin-left:'+ mg_left +'px;position:absolute;" src="__THEME__/images/zw_img.gif" /></div>'
             + '<div class="talkPop_box">'
			 + '<div class="close"><a href="javascript:void(0)" class="del" onclick=" delTypeBox()" > </a></div>'
			 + '<div id="publish_type_content">'+publish_type_html+'</div>'
			 + '</div></div>';
	$('div .talkPop').remove();
	$("#publish_type_content_before").after( html );
}
</script> 
<include file="__THEME__/footer" /> 